﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace ProgramMain.Framework
{
    public static class DataTableSerialization
    {
        public static string SerializeID(DataTable table)
        {
            return SerializeValue(table, "ID");
        }

        public static string SerializeValue(DataTable table, string valueName)
        {
            string res = "<values>";
            foreach (DataRow row in table.Rows)
            {
                res += "<value id=\"" + row[valueName] + "\"/>";
            }
            res += "</values>";
            return res;
        }
    }
}
